package com.coreJava.test02;

import java.util.List;

/**
 * 作者: LCG
 * 日期: 2019/9/3 10:42
 * 描述:
 */
public class MyRunable implements Runnable {

    private List<Integer> list;

    public MyRunable(List<Integer> list) {
        this.list = list;
    }

    @Override
    public void run() {

      test01();

    }

    public synchronized void test01(){
        for (int i=0;i<10;i++){
            list.add(i);
        }
    }

}
